package com.bridgeintelligent.tag.customer.ocdsm;

import com.ocdsm.ResultObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Author：liwei
 * @Date：2023/11/7 15:14
 * @Desc：
 */
@Api(tags="接入0CDSM")
@RestController
@RequestMapping("/api/ocdsm/")
public class OcdsmController {
    @Autowired
    private OcdsmService service;

    /**
     * 接入Ocdsm,发送文件
     * @return
     */
    @ApiOperation(value = "发送文件", notes = "OCDSM项目")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "model", value = "发送文件信息")
    })
    @PostMapping("sendFile")
    public ResultObject sendFile(@Valid @RequestBody OcdsmModel model) {
        return service.sendFile(model);
    }
    /**
     * 接入Ocdsm,获取文件传输结果
     * @return
     */
    @ApiOperation(value = "获取文件传输结果", notes = "OCDSM项目")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "zipFileName", value = "压缩文件名称")
    })
    @PostMapping("queryState")
    public ResultObject queryState(String zipFileName) {
        return service.queryState(zipFileName);
    }
}
